<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript">
	function updateUserInfo(){
		var name = document.getElementById('id_name');
		if(name.value.length==0){
			document.getElementById('id_p_error').innerHTML = '用户名不可为空！';
			return false;
		}
		var old_psw = document.getElementById('id_old_psw');
		if(old_psw.value.length>0){
			var new_psw = document.getElementById('id_new_psw');
			var confirm_new_psw = document.getElementById('id_confirm_new_psw');
			if(new_psw.value.length==0){
				document.getElementById('id_p_error').innerHTML = '新密码不可为空，请输入新密码！';
				return false;
			}
			if (new_psw.value != confirm_new_psw.value){
				document.getElementById('id_p_error').innerHTML = '两次新密码不一致，请重新输入！';
				return false;
			}
		}
		document.getElementById('id_true_psw').value = md5(new_psw.value);
		document.getElementById('id_true_old_psw').value = md5(old_psw.value);
		document.getElementById('id_update_user_info_form').submit();
		return true;
	}
</script>
<div class="con_box right">
  <div class="u_content">
    <div class="con_tit"> 
      <ul class="left"><img src="../Public/images/jiao.gif"/></ul>
      <ul class="tit_bg">首页</ul> 
    </div>
    <div class="con_main left">          
           <div class="left con_admin">
              <div class="left con_admin"><h1>个人资料<a style="color:#ff5113;">修改</a></h1></div>
              <div class="ad_change">
                  <div class="change_box" >
                    <form id="id_update_user_info_form" action="http://{$_SERVER['HTTP_HOST']}/index.php/User/updateUserInfo" method="post">
                     <p><label>用户名：</label><input id="id_name" name="name" type="text" class="input1" value="{$name}"/></p>
                     <p><label>真实姓名：</label><input id="id_true_name" name="true_name" type="text" class="input1" value="{$true_name}"/></p>
                     <p><label>角色：</label>
                     	<present name="roles[3]">
                     		<input id="id_role3" name="role3" type="checkbox" class="input2" disabled="true" checked="checked">客服
                     	<else/>
                     		<input id="id_role3" name="role3" type="checkbox" class="input2" disabled="true">客服
                     	</present>
	                    <present name="roles[2]">
	                    	<input id="id_role2" name="role2" type="checkbox" class="input2" disabled="true" checked="checked">客服管理员
	                    <else/>
	                    	<input id="id_role2" name="role2" type="checkbox" class="input2" disabled="true">客服管理员
	                    </present>	                    	
	                    <present name="roles[1]">
	                    	<input id="id_role1" name="role1" type="checkbox" class="input2" disabled="true" checked="checked">管理员
	                    <else/>
	                    	<input id="id_role1" name="role1" type="checkbox" class="input2" disabled="true">管理员
	                    </present>	                     
                     </p>
                     <p><label>旧密码：</label><input id="id_old_psw" name="old_psw" type="password" class="input1" /></p>
                     <p><label>新密码：</label><input id="id_new_psw" name="new_psw" type="password" class="input1" /></p>
                     <p><label>确认密码：</label><input id="id_confirm_new_psw" name="" type="password" class="input1" /></p>
                     <p><label>邮箱：</label><input name="email" type="text" class="input1" value="{$email}"/></p>
                     <p><label>备注：</label><textarea name="remark">{$remark}</textarea>
                     <input id="id_true_psw" name="true_psw" type="hidden"/>
                     <input id="id_true_old_psw" name="true_old_psw" type="hidden"/>
                     <input class="ci"  type="button" title="请确认信息" value="修&nbsp;&nbsp;&nbsp;改 " onclick="javascript:return updateUserInfo()"/>
                     </p>
                  </form>
                  <div><p id="id_p_error" class="p_error"><present name="msg">{$msg}</else></present></p></div>
                 </div>   
              </div> 
            </div>                    
    </div>     
  </div>
</div>
<tagLib name="html" />
<include file="Public:foot" />